package servlet;

import java.util.Enumeration;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class LoginServlet extends HttpServlet {
	
	
	@Override
	public void init(ServletConfig config) throws ServletException {
		
		Enumeration<String> en = config.getInitParameterNames();
		
		while (en.hasMoreElements()) {
			String key =  en.nextElement();
			String value = config.getInitParameter(key);
			System.out.println(key+":"+value);
			
		}
	
	}
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
		String name = request.getParameter("userName");
		String password = request.getParameter("password");
		System.out.println(name);
		System.out.println(password);
	   
//		request.getRequestDispatcher("index.jsp").forward(request, response);
	}

}
